﻿#ifndef WINDOWSPROXY_H
#define WINDOWSPROXY_H

#include <QObject>
#include <QFile>
#include <QJsonDocument>
#include <QJsonObject>
#include "client/clientcorrespond.h"
class WindowsProxy : public QObject
{
    Q_OBJECT
public:
    explicit WindowsProxy(QObject *parent = nullptr);
    
signals:
    //下面是传给UI的信号
    void signal_OpenConfig(QString json);
    void signal_ConnectStatusChange(CONNECT_STATUS);
    void signal_ForwardStatusChange(int port,CONNECT_STATUS status);
    
    //下面是传给通信类的信号
    void signal_ConnectToServer();
    void signal_OpenPort(QJsonObject info);
    void signal_ClosePort(QJsonObject info);
    void signal_dissconnectFromServer();
private:
    ClientCorrespond* proxy = nullptr;
    
public slots:
    void connectToServer(QString ip); //连接服务器
    void dissconnectFromServer();  //断开服务器
    QString openConfig();      //打开配置文件
    void openForward(QString json);  //开始转发
    void stopForward(QString json);  //停止转发
    void connectStatusChange(CONNECT_STATUS status);  //连接状态更改
    void forwardStatusChange(int port,CONNECT_STATUS status);
};

#endif // WINDOWSPROXY_H
